import React from 'react';
import { AutoComplete, Input } from 'antd';
const { TextArea } = Input;


export default class Complete extends React.Component {
  state = { dataSource: [], };

  handleSearch = value => {
    this.setState({ dataSource: !value ? [] : [value, value + value, value + value + value], })
  };

  handleKeyPress = value => {
    
  };

  render() {
    const { dataSource } = this.state;
    return (
      <AutoComplete dataSource={dataSource} style={{ width: 200 }} onSelect={(value)=> console.log('onSelect', value)} onSearch={this.handleSearch} >
        <TextArea placeholder="在这里输入" className="custom" style={{ height: 50 }} onKeyPress={(value)=>console.log('handleKeyPress', value)} />
      </AutoComplete>
    )
  }
}